package com.njtcedu.microblog.intranet.user.service;

import javax.inject.Inject;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.njtcedu.microblog.common.entity.User;
import com.njtcedu.microblog.common.web.domain.PageModel;
import com.njtcedu.microblog.intranet.user.repository.UserRepository;
import com.njtcedu.microblog.intranet.user.web.request.UserGenerateRequest;
import com.njtcedu.microblog.intranet.user.web.request.UserSearchRequest;
import com.njtcedu.microblog.intranet.user.web.response.UserInfoResponse;

@Service
@Transactional
public class UserService {
	@Inject
	private UserRepository userRepository;

	public User get(Integer userId) {
		return userRepository.get(userId);
	}

	public PageModel<UserInfoResponse> userList(UserSearchRequest searchRequest, Integer pageNo, Integer pageSize) {
		return userRepository.userList(searchRequest, pageNo, pageSize);
	}

	public void createUser(UserGenerateRequest request) {
		userRepository.createUser(request);
	}

	public boolean removeUser(Integer userId) {
		return userRepository.removeUser(userId);
	}
	
}
